// 用axios 封装一个请求前缀
import axios from 'axios';

const request = axios.create({
	baseURL: 'https://118.25.132.79/api',
	timeout: 1000,
});

// 添加响应拦截器
request.interceptors.response.use(
  response => response.data,
  error => Promise.reject(error)
);

export function getRecord(id) {
  console.log('getRecord', id)
  return request.post('/record/getRecord', { id });
}

export function updateRecord(id, data) {
  return request.post(`/record/update`, { id, ...data });
}

export default {
  getRecord,
  updateRecord,
}
